<%@ page language="java" contentType="text/html; charset=utf-8"%>
<%@page import="com.tln.sys.menu.model.Menu"%>
<%@ include file="/commons/taglibs.jsp" %>
<%@ include file="/commons/commonjs.jsp" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<html>

<head>
	<base href="<%=basePath%>">
	<title><%=Menu.TABLE_ALIAS%>新增</title>
	<script type="text/javascript">
		$(document).ready(function(){
			if(${done}=='1'){
				//Dialog.alert("保存成功！");
				Dialog.alert('保存成功',function(){
					var frames = topWin.frames;	//topWin.parent.frames	
					frames[0].mygrid.reload();
					parentDialog.close();
				},150,50);
				
				/*
				Dialog.confirm('警告：您确认要XXOO吗？',function(){
					var frames = topWin.frames;	//topWin.parent.frames	
					frames[0].mygrid.reload();
					parentDialog.close();
				});
*/
				//Dialog.close();
				
				//parent.parent.Dialog.close();			
    			/*for(var i=0;i<frames.length;i++){
    				var frame = frames[i];
    				
    				alert(frame.mygrid);
    				
    				//alert($.toJSON(frame));
    				if(frame.mygrid){
    					//alert(frames.length);
    					frame.mygrid.reload();
    				}
    			}*/
			}
		})
	</script>
</head>

<body>
<%@ include file="/commons/messages.jsp" %>

<form:form method="post" action="${ctx}/sys/menu" modelAttribute="menu" >
	<input id="submitButton" name="submitButton" type="submit" value="提交" />
	<input onClick="parentDialog.close();" type="button" value="关闭" />
	<input type="button" value="后退" onclick="history.back();"/>
	
	<table class="formTable">
	<input type="hidden" id="id" name="id" value="${menu.id}"/>

	<tr>	
		<td class="tdLabel">
			<%=Menu.ALIAS_ICON%>:
		</td>		
		<td>
		<form:input path="icon" id="icon" cssClass="" maxlength="50" />
		</td>
	</tr>	
	
	<tr>	
		<td class="tdLabel">
			<%=Menu.ALIAS_MENU_NAME%>:
		</td>		
		<td>
		<form:input path="menuName" id="menuName" cssClass="" maxlength="50" />
		</td>
	</tr>	
	
	<tr>	
		<td class="tdLabel">
			<%=Menu.ALIAS_PARENT_ID%>:
		</td>		
		<td>
		<form:input path="parentId" id="parentId" cssClass="" maxlength="50" />
		<%--
		<input value="${menu.parentId}" onclick="WdatePicker({dateFmt:'<%=Menu.FORMAT_BIRTH_DATE%>'})" id="birthDateString" name="birthDateString"  maxlength="0" class="" />
		 --%>
		</td>
	</tr>	
	
	<tr>	
		<td class="tdLabel">
			<%=Menu.ALIAS_URL%>:
		</td>		
		<td>
		<form:input path="url" id="url" cssClass="validate-integer " maxlength="4" />
		</td>
	</tr>	
	
	</table>
</form:form>
</body>
</html>
